home *** CD-ROM | disk | FTP | other *** search
/ Practical Algorithms for Image Analysis / Practical Algorithms for Image Analysis.iso / CH_5.7 / XSGLL / SAL.H < prev    next >
C/C++ Source or Header  |  1999-09-11  |  2KB  |  49 lines

  1. /*
  2.  * SAL.H
  3.  *
  4.  * structure defs for xllist.c
  5.  *
  6.  */
  7. #ifndef _SAL_H_
  8. #define    _SAL_H_
  9.  
  10. /* structure definitions */
  11. struct point {                  /* point */
  12.   short x;
  13.   short y;
  14. };
  15.  
  16.  
  17. typedef struct Segmtype {       /* linear segment */
  18.   struct point ptO;             /* coord. of initial point of seg. */
  19.   struct point ptF;             /* coord. of final point of seg. */
  20.  
  21.   float slope;                  /* slope of segm {pt1, pt2} */
  22.  
  23.   float pij;                    /* overlap of cur segm i wrt segm j */
  24.   float pji;                    /* inverse overlap */
  25.   float dij;                    /* perp dist from segm i to midpt of ov_ij */
  26.  
  27.   int line_ind;                 /* index of parent line */
  28.   int segm_ind;                 /* scan index (i) of segm under inspection */
  29.  
  30.   int sgl_level;                /* level of indirection in SGL assignment (0,1,2) */
  31.   Boolean SalStat;              /* sgll(): when all segm in SAL<segm> InAct, InAct */
  32. } SegmT;
  33.  
  34.  
  35. /* function prototypes */
  36. extern int cmpSegmdist (struct Segmtype *oldSegm, struct Segmtype *newSegm);
  37. extern Boolean cmpdij (struct Segmtype *newSegm, int sign_dij,
  38.                        struct linklist *sall);
  39. extern void init_sall (struct linklist *segm_adj_list);
  40. extern void show_segm_list (struct linklist *list, int index);
  41. extern float slope (struct point pt1, struct point pt2);
  42. extern void init_testsegm (struct Segmtype *testsegm, int n_segm);
  43. extern void show_segment (struct Segmtype *Segm);
  44. extern void construct_sall (struct linklist *sall,
  45.                             struct Segmtype *testsegm, int n_segm);
  46. extern int main (int argc, char **argv);
  47.  
  48. #endif /* _SAL_H_ */
  49.